<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">

        <ui:define name="content">
            <br/>

            <h:form prependId="false">

                
    <p:panel toggleable="true" id="ReserveList" header="Reservations">
                    <p:dataTable value="#{reservationEntityController.reservationItems}" 
                                 var="item"  
                                 style="table-layout:fixed" paginator="true" rows="10"  
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                 rowsPerPageTemplate="5,10,15">  
                        <p:column filterBy="#{item.id}">
                            <f:facet name="header">
                                <h:outputText value="Reservation #"/>
                            </f:facet>
                            <h:outputText value="#{item.id}"/>
                        </p:column>

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Sales Order #"/>
                            </f:facet>
                            <h:outputText value="#{item.salesOrder.id}"/>
                        </p:column>
                     
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Product Name"/>
                            </f:facet>
                            <h:outputText value="#{item.product.productName}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Quantity"/>
                            </f:facet>
                            <h:outputText value="#{item.quantity}"/>
                        </p:column>

                    </p:dataTable>
                </p:panel>
                
                <p:panel toggleable="true" id="plannedReserveList" header="Planned Reservations">
                    <p:dataTable value="#{plannedReserveEntityController.items}" 
                                 var="item"  
                                 style="table-layout:fixed" paginator="true" rows="10"  
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                                 rowsPerPageTemplate="5,10,15">  
                        <p:column filterBy="#{item.id}">
                            <f:facet name="header">
                                <h:outputText value="Planned Reservation #"/>
                            </f:facet>
                            <h:outputText value="#{item.id}"/>
                        </p:column>

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Sales Order #"/>
                            </f:facet>
                            <h:outputText value="#{item.salesOrder.id}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Fulfilment Date"/>
                            </f:facet>
                            <h:outputText value="#{item.monthOfProduction}/#{item.yearOfProduction}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Product Name"/>
                            </f:facet>
                            <h:outputText value="#{item.product.productName}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Quantity"/>
                            </f:facet>
                            <h:outputText value="#{item.quantity}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Amount Fulfilled"/>
                            </f:facet>
                            <h:outputText value="#{item.amountFulfilled}"/>
                        </p:column>

                    </p:dataTable>
                </p:panel>
                
              
            </h:form>

        </ui:define>
    </ui:composition>

</html>
